package com.example.quicklaunch;

import android.content.Intent;
import android.os.IBinder;

public class Service extends android.app.Service{

    @Override
    public IBinder onBind(Intent intent) {
        return null;
    }
    @Override
    public void onCreate() {
        super.onCreate();
        System.out.println("yadong --- oncreate");
    }

    @Override
    public int onStartCommand(Intent intent, int flags, int startId) {
        int clickid = intent.getIntExtra(QuickLaunchWidgetProvider.EXTRA_CLICK_ID, -1);
        String keyCode = null;
        switch (clickid) {
            case R.id.zero:
                keyCode = "0";
                break;
            case R.id.two:
                keyCode = "2";
                break;
            case R.id.three:
                keyCode = "3";
                break;
            case R.id.four:
                keyCode = "4";
                break;
            case R.id.five:
                keyCode = "5";
                break;
            case R.id.six:
                keyCode = "6";
                break;
            case R.id.seven:
                keyCode = "7";
                break;
            case R.id.eight:
                keyCode = "8";
                break;
            case R.id.nine:
                keyCode = "9";
                break;
            case R.id.one:
                keyCode = "1";
                break;
            case R.id.delete:
                keyCode = "del";
                break;
            default:
                break;
        }
        System.out.println("Yadong onStartCommand = " + keyCode);
        return super.onStartCommand(intent, flags, startId);
    }


}
